<?php

require_once 'Zend/Db/Table/Abstract.php';

class Application_Model_Teachers extends Zend_Db_Table
{
    protected $_name = 'teachers';
    protected $_primary='id';
    
    public function changeimg($name,$headimg)
    {
        $teacher = $this->fetchRow("`nickname`=\"$name\"")->toArray();
        $data = array(
                'headimg'=>$headimg
                );
        $teacherid = $teacher['id'];
        $this->update($data,"`id`=$teacherid");
    }
}

